package com.mima.minaserver.repository;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.mima.minaserver.entity.Camera;
import com.mima.minaserver.entity.MyUUID;

@Repository
public interface IotServerMessageManagerRepository extends JpaRepository<MyUUID, String>{

	
	
	
	@Query(value = "select * from t_camera where uuid = ?", nativeQuery = true)
	public Camera findDeviceByUUID(String UUID);

	
	@Query(value = "select account,password,secret_key,key_id from t_uuid where uuid = ?1", nativeQuery = true)
	public Object deviceLoginInfo(String uuid);

	
	@Query(value = "update t_uuid set is_active = ?1  where uuid  = ？2", nativeQuery = true)
	public List<Object> deviceOnOffInfo(String uuid,Integer device_status);
	
	@Query(value = "select * from t_uuid where uuid = ?1", nativeQuery = true)
	public MyUUID findUUIDByUUID(String UUID);

}
